package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotation.LagouAutowired;
import com.lagou.edu.mvcframework.annotation.LagouController;
import com.lagou.edu.mvcframework.annotation.LagouRequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@LagouRequestMapping("/demo")
@LagouController
public class DemoController {

    @LagouAutowired
    private IDemoService demoService;

    @LagouRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) throws IOException {
        return demoService.get(name);
    }
}
